package com.fyl.pattern.command;

import java.util.Map;

/**
 * 具体的命令类
 */
public class OrderCommand implements Command {
    //接收命令的对象
    private SeniorChef seniorChef;

    private Order order;

    public OrderCommand(SeniorChef seniorChef, Order order) {
        this.seniorChef = seniorChef;
        this.order = order;
    }


    @Override
    public void execute() {
        System.out.println(order.getDiningTable()+"桌的订单：");
        Map<String, Integer> foodDir = order.getFoodDir();
        for (String name : foodDir.keySet()) {
            seniorChef.makeFood(name,foodDir.get(name));
        }
        System.out.println(order.getDiningTable()+"桌的菜准备好了");
    }
}
